home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10517 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  46 lines

  1. Newsgroups: comp.lang.c++
  2. Path: ncrgw2.ncr.com!ncrhub2!lznj2!lziss3!netnews
  3. From: Arnold Bursian <arnold.bursian@germany.ncr.com>
  4. Subject: Re: Need help making C program, C++
  5. Content-Type: text/plain; charset=us-ascii
  6. Message-ID: <31401309.5E0F@germany.ncr.com>
  7. Sender: netnews@lziss3.lincroftnj.ncr.com (51[news]-Netnews Admin)
  8. Content-Transfer-Encoding: 7bit
  9. Organization: AT&T GIS Lincroft, NJ USA
  10. References: <313E7AE3.6F9C@cp.duluth.mn.us>
  11. Mime-Version: 1.0
  12. Date: Fri, 8 Mar 1996 10:59:21 GMT
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. Yan Saillard wrote:
  16. > I'm writing a calculator program for a class assignment and its already
  17. > done in C and I wanted to "convert it" to C++. Any help would be
  18. > appreciated!
  19. > Here's the messages I got after compiling it (turbo c++ 3.1) with the
  20. > lines below.
  21. > *Warning CALK.CPP 19: Style of function definition is now obsolete
  22. > int doOp(o,r) char o; int r;
  23. > *Warning CALK.CPP 30: Style of function definition is now obsolete:
  24. > void showResult(r) int r;
  25. > What would be the way C++ defines functions?
  26. > *Error CALK.CPP 39: Function 'getchar' should have a prototype
  27. > while((op = getchar()) != 'q')
  28. > this program ran fine in C.
  29. > Thanks!
  30.  
  31. Use following definition for questions 1&2
  32.  
  33. 1: int doOp(char o, int r);
  34.  
  35. 2: void showResult( int r);
  36.  
  37. For question 3: Make sure you included 'stdio.h'
  38.